import { ref } from 'vue';
import { defineStore } from 'pinia';

export const useGlobal = defineStore('global', () => {
  // 修改菜单栏状态
  const collapsed = ref(false); // 菜单栏收起
  function changeColl() {
    collapsed.value = !collapsed.value;
  }

  // 获取页面标题
  const title = ref(''); //
  function setTitle(name: string) {
    title.value = name;
  }

  return { collapsed, changeColl, title, setTitle };
});
